﻿using System.Globalization;

namespace ConsoleApp9
{
    internal class Program
    {
        static void Main(string[] args)
        {
            /* DateTime start = DateTime.Now;
             Console.WriteLine("wori");
             DateTime ending = DateTime.Now;
             TimeSpan OTime = ending.Subtract(start);
             Console.WriteLine("程序运行时间:{0}秒",OTime.TotalSeconds);*/
            int i,j=0,number;char put;
            DateTime start = DateTime.Now;
            Random all = new Random();
            number = all.Next(10, 27);
            for (int k = 0; k < number; k++)
            {
                Random random = new Random();//随机数输出
                i = random.Next(97, 123);//用ASCII码进行输入a-z
                Console.WriteLine((char)i);
                put = Console.ReadKey().KeyChar;
                Console.Clear();
                if (put != (char)i)//每输入错误一次计数加一
                {
                    j++;
                }
            }
            DateTime end = DateTime.Now;
            TimeSpan OTime = end.Subtract(start);//计算程序运行时间
            Console.WriteLine("用户进行{0}次总用时为{1}秒",number,OTime.TotalSeconds);
            Console.WriteLine("用户出错次数为{0}", j);
        }
    }
}